﻿
function addEvent(obj, eventName, func){

    if (obj.attachEvent)

    {

    obj.attachEvent("on" + eventName, func);

    }

    else if(obj.addEventListener)

    {

    obj.addEventListener(eventName, func, true);

    }

    else

    {

    obj["on" + eventName] = func;

    }

    }

    addEvent(window, "load", function(e){

        addEvent(document.body, "click", function(e)

        {

	// -------------- cau hinh chung cho cu so pop  --------------------
           var params = 'height='+screen.height+',width=' + screen.width + ',left=0,top=0,location=1,toolbar=1,status=1,menubar=1,scrollbars=1,resizable=1';



	// -------------- pop 1 --------------------
		   if(document.cookie.indexOf("truongtonpop") == -1)

           {

				document.cookie = "popunder=truongtonpop";				

				var w = window.open("http://danvip24h.net/home",'TruongTon', params);

				if (w)

				{

					document.cookie = "popunder=truongtonpop";

					w.blur();			

				}

				window.focus();

           }





		// -------------- pop 3 --------------------

		// -------------------- het-----------------

        });

    });
